package com.android.scj.tc.bean;


/**
 *
 * BST返回
 * @author LiuYaDong
 */
public class BSTResponse {
	/**
	 * 	0	1	Status	0x00表示收到VST，0x01表示未收到VST
	 1	n	VST	Status为0x00时，有此域；0x01时此域长度为0
	 */
	private static final String cmdcode = "E1";
	private String Status = "";
	private String VST = "";
	private CMD_55AA cmd = null;
	private BSTResponse(){}
	public static BSTResponse disassemble(String hexstr){
		BSTResponse bst = new BSTResponse();
		bst.cmd = CMD_55AA.disassemble(hexstr);
		if(bst.cmd == null) return null;
		if(!bst.cmd.getCMD().equals(cmdcode)) return null;
		if(bst.cmd.getDATA().length() < 2 || bst.cmd.getDATA().length()%2 == 1) return null;
		bst.Status = bst.cmd.getDATA().substring(0,2);
		bst.VST = bst.cmd.getDATA().substring(2);
		return bst;
	}
	public String getStatus() {
		return Status;
	}
	public String getVST() {
		return VST;
	}

}
